import axios from "axios"
const baseUrl = 'http://localhost:3000' //统一请求前缀
const get = (url,params) => {
  return new Promise((resolve,reject) => {
    axios({
      url: baseUrl + url,
      method: 'get',
      params: {
        article_id: params
      }
    })
    .then(res => {
       resolve(res.data)         //返回请求数据
    })
    .catch(err => {
      reject(err.data)          //返回错误
    })
  })
}
export default get